﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/MasterPage.master" AutoEventWireup="true"
    CodeFile="BUInfoMaintain.aspx.cs" Inherits="BaseInfoManagement_BUInfoMaintain" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">

        function Closed() {
            window.opener = null; window.close();
        }
        function CheckAllItem(oChcek) {
            CheckAll(oChcek, '<%= gvBUList.ClientID %>', '<%= hidBU.ClientID %>');
        }

        function CheckItem(oChcek) {
            CheckItemCB(oChcek, '<%= gvBUList.ClientID %>', '<%= hidBU.ClientID %>');
        }
        function ConfigPU() {
            var retval = document.getElementById('<%= hidBU.ClientID %>').value;
            window.returnValue = retval;
            Closed();
        }

        function openWinForModify(BUID) {
            var selectPage = 'ModifyBuInfo.aspx' + "?action=upd&BUID=" + BUID + "&time=" + (new Date()).getTime().toString();
            window.showModalDialog(selectPage, 'newwindow', 'dialogHeight: 450px; dialogWidth: 670px; center: yes; help: no; resizable: no; status: no;scroll:auto');
        }
        function openWin() {
            var selectPage = 'ModifyBuInfo.aspx' + "?action=add&time=" + (new Date()).getTime().toString();
            window.showModalDialog(selectPage, 'newwindow', 'dialogHeight: 450px; dialogWidth: 670px; center: yes; help: no; resizable: no; status: no;scroll:auto');

        }
    </script>
    <style>
        .modalPopup
        {
            background-color: #FAD817;
            border-width: 3px;
            border-style: solid;
            border-color: Gray;
            padding: 3px;
            width: 250px;
        }
        .modalBackground
        {
            filter: alpha(opacity=70);
            opacity: 0.7;
        }
    </style>
    <script src="../Themes/Js/checkItem.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript" src="../Themes/MyCalendar/WdatePicker.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TabTitle" runat="Server">
    <asp:Literal runat="server" ID="title" Text="<%$ Resources:Resource,BUInfoManage %>"></asp:Literal>
    <%--BU信息管理--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <div style="width: 100%;">
        <div class="queryDiv1">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="divFrameHead">
                       <span class="querytextCss">
                    <%=Resources.Resource.Query%><%--查询条件--%></span>
                    </td>
                </tr>
                <tr>
                    <td class="submitborder" style="padding-top: 15px; padding-bottom: 15px;">
                        <table style="margin-bottom: 10px;" width="95%" border="0" align="center" cellpadding="0"
                            cellspacing="0">
                            <tr>
                                <td class="submitborder4">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td class="submitFieldbg">
                                                BU
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtBUName" runat="server" Width="120px"></asp:TextBox>
                                                &nbsp;
                                            </td>
                                            <td class="submitFieldbg">
                                                <%=Resources.Resource.Modifier%><%--修改人--%>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtModifyPer" runat="server" Width="120px"></asp:TextBox>
                                                &nbsp;
                                            </td>
                                            <td class="submitFieldbg">
                                                <%=Resources.Resource.ModifyTime%><%--修改时间--%>&nbsp;
                                            </td>
                                            <td align="left">
                                                 <input type="text" id="txtMaintenanceStartTime" runat="server" class="Wdate" style="width: 120px"
                                onfocus="WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd'})" />
                                                &nbsp;
                                                 至
                                                  &nbsp;
                                                  <input type="text" id="txtMaintenanceEndTime" runat="server" class="Wdate" style="width: 120px"
                                onfocus="WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd'})" />
                                            </td>
                                              <td align="left">                                              
                                            </td>
                                              <td align="left">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <div style="text-align: center;">
                    <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:Resource,btnEnquiry%>"
                        OnClick="btnSearch_Click" />
                    <%--查 询--%>
                    &nbsp;&nbsp;
                    <asp:Button ID="btnAdd" runat="server" Text="<%$Resources:Resource,btnNew%>" OnClientClick="openWin()"
                        OnClick="btnSearch_Click" />
                    <%--新 建--%>
                </div>
                    </td>
                </tr>
            </table>
        </div>
        <div class="GridDivCss">
            <IMC:GridView ID="gvBUList" runat="server" AllowPaging="true" AllowSorting="true"
                PageSize="10" OnRowCommand="gvBUList_RowCommand" DataSourceID="BUViewDataSource">
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-Width="15%" ItemStyle-Width="15%" Visible="false">
                        <HeaderTemplate>
                            <asp:CheckBox ID="all" runat="server" onclick="CheckAllItem(this)" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="single" runat="server" onclick="CheckItem(this)" />
                            <input type="hidden" id="hidDiv" value='<%#Eval("BUID")%>,<%#Eval("BUName")%>,<%#Eval("BUCapacity")%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="BU" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lbMounterType" runat="server" Text='<%#Eval("BUName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$Resources:Resource, Ability%>" ItemStyle-HorizontalAlign="Center" Visible="false">
                        <%--能力--%>
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lbMounterAbility" runat="server" Text='<%#Eval("BUCapacity") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$Resources:Resource,Modifier %>" ItemStyle-HorizontalAlign="Center">
                        <%--修改人--%>
                        <ItemTemplate>
                            &nbsp;
                            <asp:Label ID="lbModifyPer" runat="server" Text='<%#Eval("ModifyPerson") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$Resources:Resource,ModifyTime %>" ItemStyle-HorizontalAlign="Center">
                        <%--修改时间--%>
                        <ItemTemplate>
                            &nbsp;<asp:Label ID="lbModifyTime" runat="server" Text='<%#ConvertDateType.DateTimeTryFormat(Eval("ModifyDateTime")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$Resources:Resource,Operating %>" ItemStyle-HorizontalAlign="Center">
                        <%--操 作--%>
                        <ItemTemplate>
                            <a href="javascript:openWinForModify('<%#Eval("BUID") %>')">
                                <%=Resources.Resource.btnMaintain %>
                            </a>
                            <%--修改--%>
                            <asp:LinkButton ID="lbtnDel1" runat="server" CommandName="Del" ValidationGroup="DelMassnahme"
                                CommandArgument='<%#Eval("BUID") %>' OnClientClick="return isDel()"><%=Resources.Resource.btnDel %></asp:LinkButton>
                            <%--删除--%>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </IMC:GridView>
            <asp:ObjectDataSource ID="BUViewDataSource" runat="server" TypeName="BUViewDataSource"
                SelectMethod="Select">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtBUName" PropertyName="Text" Name="BUName" Type="String" />
                    <asp:ControlParameter ControlID="txtModifyPer" PropertyName="Text" Name="ModifyPerson"
                        Type="String" />
                    <asp:ControlParameter ControlID="txtMaintenanceStartTime" PropertyName="Value" Name="startTime"
                        Type="String" />
                    <asp:ControlParameter ControlID="txtMaintenanceEndTime" PropertyName="Value" Name="endTime"
                        Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
        <div style="text-align: center; padding-top: 10px;">
            <input id="btnVendorContactOK" type="button" class="buttonbgYellow" value="<%$Resources:Resource,btnOK %>"
                onclick="ConfigPU()" runat="server" visible="false" />
            <%--确 定--%>
            <input id="btnVendorContactCancel" type="button" class="buttonbgYellow" value="<%$Resources:Resource,btnClear %>"
                onclick="Closed()" runat="server" visible="false" />
            <%--取 消--%>
        </div>
        <asp:HiddenField ID="hidBU" runat="server" />
    </div>
    <script>
        function isDel() {
            return confirm('<%=Resources.Resource.IsDelete %>');
        }
    </script>
</asp:Content>
